package start.doubudouyin.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import jakarta.annotation.Resource;
import start.doubudouyin.entity.Videocomment;
import start.doubudouyin.mapper.VideolikeMapper;
import start.doubudouyin.service.VideocommentService;
import start.doubudouyin.mapper.VideocommentMapper;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author mmmm
 * @description 针对表【videocomment(视频评论表)】的数据库操作Service实现
 * @createDate 2025-06-09 14:26:17
 */
@Service
public class VideocommentServiceImpl extends ServiceImpl<VideocommentMapper, Videocomment>
        implements VideocommentService {

    @Resource
    private VideocommentMapper videocommentMapper;

    @Override
    public boolean insert(Videocomment videocomment) {
        if (videocommentMapper.insertComment(videocomment) > 0) //  插入成功
            return true;
        return false;
    }

    @Override
    public List<Videocomment> getComment(String videoId) {
        return videocommentMapper.getComment(videoId);
    }

    public Integer recordComment(String userId,String videoId){
        return videocommentMapper.recordComment(userId,videoId);
    }
}




